package com.gensdai.leliang.dialog;


import android.app.ActionBar.LayoutParams;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ProgressBar;

import com.gensdai.leliang.R;

public class Upload {
	Context mContext;
	Dialog dialog;
	public Upload(Context mContext) {
		super();
		this.mContext = mContext;
		initdialog();
	}
    public void initdialog(){
    	
    	
    	ProgressBar jiazai_dielog;
    	
    	dialog = new Dialog(mContext,R.style.dialog_head);
    	dialog.setContentView(R.layout.upload);
    	Window dialogWindow = dialog.getWindow();
    	dialogWindow.setLayout(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    	WindowManager.LayoutParams lp = dialogWindow.getAttributes();
    	dialogWindow.setGravity(Gravity.CENTER);
//    	dialogWindow.setWindowAnimations(R.anim.head_start_dialog);
//    	dialog.setCanceledOnTouchOutside(true);
    	dialog.setCanceledOnTouchOutside(false);

    	jiazai_dielog = (ProgressBar) dialog.findViewById(R.id.jiazai_dielog);
    	
    	
    }
    
    public void show(){
    	dialog.show();
    }
    public void dismiss(){
		if(dialog != null && dialog.isShowing())
    			dialog.dismiss();
    }

    public boolean isShowing(){
		return dialog.isShowing();
	}
}
